/*    */ package com.hp.bon.logreverse.perf;
/*    */ 
/*    */ import com.hp.ocs.diameter.message.Message;
/*    */ import com.hp.ocs.diameter.node.Peer;
/*    */ import java.util.List;
/*    */ import javax.ws.rs.GET;
/*    */ import javax.ws.rs.Path;
/*    */ import javax.ws.rs.PathParam;
/*    */ import javax.ws.rs.Produces;
/*    */ import org.slf4j.Logger;
/*    */ import org.slf4j.LoggerFactory;
/*    */ 
/*    */ @Path("/")
/*    */ public class DCCPerfTestProcess extends PerfTestProcess
/*    */ {
/* 18 */   private static final Logger LOG = LoggerFactory.getLogger(DCCPerfTestProcess.class);
/*    */   private SimpleDCCServer dccServer;
/*    */ 
/*    */   public boolean doCapsOperate(List<Object> tempList, int beginIdx, int endIdx, boolean isLog)
/*    */   {
/* 22 */     if (endIdx - beginIdx > 0) {
/* 23 */       Peer activePeer = this.dccServer.getActivePeer(null);
/* 24 */       if (activePeer == null) {
/* 25 */         if (isLog)
/*    */         {
/* 27 */           LOG.info("not active diameter peer to send message ");
/*    */         }
/* 29 */         return false;
/*    */       }
/* 31 */       for (int i = beginIdx; i < endIdx; i++) {
/* 32 */         Message request = (Message)tempList.get(i);
/* 33 */         this.dccServer.sendRequest(request, activePeer);
/*    */       }
/* 35 */       if (isLog)
/*    */       {
/* 37 */         LOG.info("send message num= " + (endIdx - beginIdx) + " to peer=" + activePeer + ",object=" + tempList.get(endIdx - 1));
/*    */       }
/*    */ 
/*    */     }
/* 41 */     else if (isLog)
/*    */     {
/* 43 */       LOG.info("no dcc message to send");
/*    */     }
/*    */ 
/* 46 */     return true; } 
/* 52 */   @GET
/*    */   @Path("perftest/Caps/{caps}")
/*    */   @Produces({"application/json"})
/*    */   public String setNewCaps(@PathParam("caps") int caps) { super.setCaps(caps);
/* 53 */     return "change caps to " + this.capsTarget + " TPS";
/*    */   }
/*    */ 
/*    */   public SimpleDCCServer getDccServer()
/*    */   {
/* 58 */     return this.dccServer;
/*    */   }
/*    */ 
/*    */   public void setDccServer(SimpleDCCServer dccServer) {
/* 62 */     this.dccServer = dccServer;
/*    */   }
/*    */ }

/* Location:           C:\Users\think\Desktop\sgw_2.1.jar
 * Qualified Name:     com.hp.bon.logreverse.perf.DCCPerfTestProcess
 * JD-Core Version:    0.6.1
 */